#pragma once

#include "stdafx.h"

#include "Matrix.h"

#ifndef NDEBUG
using std::cout;
using std::endl;
#endif

class Board
{
public:
	Board(void);
	Board(int const& _row, int const& _column);
	~Board(void);
	typedef Matrix<int>::MatrixType InfoType;
	size_t const getColumn() const
	{
		return matrix->getColumn() - 2;
	}
	size_t const getRow() const
	{
		return matrix->getRow() - 2;
	}
	Matrix<int> getNeighborsInfo(size_t const&, size_t const&);
	void setSquare(size_t const& _row, size_t const& _column, int const& value)
	{
		matrix->at(_row + 1, _column + 1) = value;
	}
	void swap(Board otherBoard)
	{
		std::auto_ptr<Matrix<int> > tmp (matrix.release());
		matrix.reset(otherBoard.matrix.release());
		otherBoard.matrix.reset(tmp.release());
	}
	std::vector<int> const * toVector() const;
	InfoType toInfoType() const
	{
		return *matrix;
	}
	void randomize(void);
private:
	static int const default_size;
	std::auto_ptr<Matrix<int> > matrix;
};
